home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / cuj1008.zip / 1008084A < prev    next >
Text File  |  1991-12-04  |  846b  |  48 lines

  1. // anyclass.hpp
  2. // declaration of anyClass, a test
  3. // class, and declaration of
  4. // RefCntPtr to anyClass
  5.  
  6. #ifndef CLASS_anyClass
  7.  #define CLASS_anyClass
  8.  
  9.  #include "refptr.hpp"
  10.  #include "refitem.hpp"
  11.  
  12.  #include <iostream.h>
  13.  
  14.  class anyClass : public RefCntItem
  15.   {
  16.    public:
  17.  
  18.     int intVal;
  19.     char *string;
  20.  
  21.     anyClass (void)
  22.       : RefCntItem()
  23.       , intVal(0)
  24.       , string(0)
  25.       {
  26.         cout << "anyClass constructor\n\n";
  27.       };
  28.  
  29.     ~anyClass (void)
  30.       {
  31.         cout << "anyClass destructor\n";
  32.         show();
  33.       };
  34.  
  35.     void show(void)
  36.       {
  37.         cout << "anyClass contents:\n"
  38.              << intVal << " "
  39.              << string << "\n"
  40.              << "reference count: "
  41.              << refCnt() << "\n\n";
  42.       };
  43.   };
  44.  
  45.  RefCntPtrDECLARE(anyClass)
  46.  
  47. #endif
  48.